import { TABLE_COLUMNS, AUTHORITY } from './constants';
import getTableMixin from '../../mixins/table';

export default {
  data () {
    return {
      TABLE_COLUMNS,
    };
  },
  methods: {
    createDynamicProps (item, row) {
      return {
        ...item.props,
        disabled: !AUTHORITY[row.level].includes(item.key),
      };
    },
  },
  mixins: [
    // hided logic
    getTableMixin({
      searchFuncName: 'updateUserList',
      storeModuleName: 'employees',
      storeListField: 'userList',
      storeTotalField: 'total',
      storeUpdateFuncName: 'updateUserList',
    }),
  ],
};
